import 'package:cached_network_image/cached_network_image.dart';
import 'package:flutter/material.dart';
import 'package:hc_ui/constants/hc_color.dart';

import '../widget/image/hc_image.dart';

class HcImageConfig {
  // 是否允许dark模式
  final bool enableDarkMode;

  //dark模式下背景蒙版颜色
  final Color maskColor;

  // 如果图片显示错误的样式
  final ImageErrorBuilder? errorBuilder;

  //网络访问头
  final Map<String, String>? httpHeader;

  //加载方法
  final ProgressIndicatorBuilder? loadingBuilder;

  //动画淡出时间
  final Duration fadeOutDuration;

  //动画进入时间
  final Duration fadeInDuration;

  //淡出动画
  final Curve fadeOutCurve;

  //淡入动画
  final Curve fadeInCurve;

  //圆角默认值
  final BorderRadius borderRadius;
  final FilterQuality filterQuality;

  HcImageConfig(
      {this.filterQuality = FilterQuality.low,
      this.borderRadius = BorderRadius.zero,
      this.fadeOutDuration = const Duration(milliseconds: 1000),
      this.fadeOutCurve = Curves.easeOut,
      this.fadeInDuration = const Duration(milliseconds: 500),
      this.fadeInCurve = Curves.easeIn,
      this.httpHeader,
      this.maskColor = HcColor.imageMaskColor,
      this.errorBuilder,
      this.loadingBuilder,
      this.enableDarkMode = true});
}
